<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>ubuntu上搭建dokuwiki | ZY&#39;s Blog</title>
  <meta name="keywords" content=" dokuwiki , ubuntu ">
  <meta name="description" content="ubuntu上搭建dokuwiki | ZY&#39;s Blog">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="页面未找到！">
<meta property="og:type" content="website">
<meta property="og:title" content="404">
<meta property="og:url" content="http://yoursite.com/404.html">
<meta property="og:site_name" content="ZY&#39;s Blog">
<meta property="og:description" content="页面未找到！">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-01-01T03:11:11.000Z">
<meta property="article:modified_time" content="2020-01-12T05:11:14.818Z">
<meta property="article:author" content="ZY">
<meta name="twitter:card" content="summary">


<link rel="icon" href="/img/avatar.jpg">

<link href="/css/style.css?v=1.0.1" rel="stylesheet">

<link href="/css/hl_theme/github.css?v=1.0.1" rel="stylesheet">

<link href="//cdn.bootcss.com/animate.css/3.5.2/animate.min.css" rel="stylesheet">
<link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script src="//cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="/js/jquery.autocomplete.min.js?v=1.0.1" ></script>

<script src="//cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
<script>
    hljs.initHighlightingOnLoad();
</script>

<script src="//cdn.bootcss.com/nprogress/0.2.0/nprogress.min.js"></script>



<script src="//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js" ></script>

<script src="/js/iconfont.js?v=1.0.1" ></script>

<meta name="generator" content="Hexo 4.2.0"></head>
<div style="display: none">
  <input class="theme_disqus_on" value="false">
  <input class="theme_preload_comment" value="false">
  <input class="theme_blog_path" value="">
</div>

<body>
<aside class="nav">
    <div class="nav-left">
        <a href="/" class="avatar_target">
    <img class="avatar" src="/img/avatar.jpg" />
</a>
<div class="author">
    <span>ZY</span>
</div>

<div class="icon">
    
        
        <a title="email" href="mailto:zh.yao@foxmail.com" target="_blank">
            
                <svg class="iconfont-svg" aria-hidden="true">
                    <use xlink:href="#icon-email"></use>
                </svg>
            
        </a>
        
    
        
        <a title="github" href="https://github.com/zhangyaaoo" target="_blank">
            
                <svg class="iconfont-svg" aria-hidden="true">
                    <use xlink:href="#icon-github"></use>
                </svg>
            
        </a>
        
    
        
        <a title="csdn" href="https://blog.csdn.net/QCZTZSWT357" target="_blank">
            
                <svg class="iconfont-svg" aria-hidden="true">
                    <use xlink:href="#icon-csdn"></use>
                </svg>
            
        </a>
        
    
        
        <a title="qq" href="http://wpa.qq.com/msgrd?v=3&uin=357509508&site=qq&menu=yes" target="_blank">
            
                <svg class="iconfont-svg" aria-hidden="true">
                    <use xlink:href="#icon-qq"></use>
                </svg>
            
        </a>
        
    
</div>




<ul>
    <li><div class="all active">全部文章<small>(8)</small></div></li>
    
        
            
            <li><div data-rel="嵌入式">嵌入式<small>(2)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="Tools">Tools<small>(3)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="Linux">Linux<small>(1)</small></div>
                
            </li>
            
        
    
        
            
            <li><div data-rel="Hexo">Hexo<small>(2)</small></div>
                
            </li>
            
        
    
</ul>
<div class="left-bottom">
    <div class="menus">
    
    
    
    
    </div>
    <div><a class="about  hasFriend  site_url"  href="/about">关于</a><a style="width: 50%"  class="friends">友链</a></div>
</div>
<input type="hidden" id="yelog_site_posts_number" value="8">
<input type="hidden" id="yelog_site_word_count" value="8.3k">
<div style="display: none">
    <span id="busuanzi_value_site_uv"></span>
    <span id="busuanzi_value_site_pv"></span>
</div>

    </div>
    <div class="nav-right">
        <div class="friends-area">
    <div class="friends-title">
        友情链接
        <i class="back-title-list"></i>
    </div>
    <div class="friends-content">
        <ul>
            
            <li><a target="_blank" href="http://yelog.org/">叶落阁</a></li>
            
        </ul>
    </div>
</div>
        <div class="title-list">
    <form onkeydown="if(event.keyCode === 13){return false;}">
        <input id="local-search-input" class="search" type="text" placeholder="以 in: 开头进行全文搜索" />
        <i class="cross"></i>
        <span>
            <label for="tagswitch">Tags:</label>
            <input id="tagswitch" type="checkbox" style="display: none" />
            <i id="tagsWitchIcon"></i>
        </span>
    </form>
    <div class="tags-list">
    
    <li class="article-tag-list-item">
        <a class="color4">GCC</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color4">Git</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color4">嵌入式</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color4">IIC</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color1">Linux</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color4">MTD Subsystem</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color4">dokuwiki</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color2">ubuntu</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color5">Hexo</a>
    </li>
    
    <li class="article-tag-list-item">
        <a class="color4">VIM</a>
    </li>
    
    <div class="clearfix"></div>
</div>

    
    <div id="local-search-result">

    </div>
    
    <nav id="title-list-nav">
        
        <a  class="嵌入式 "
           href="/2019/12/23/GCC-%E5%B8%B8%E7%94%A8%E5%8F%82%E6%95%B0/"
           data-tag="GCC"
           data-author="" >
            <span class="post-title" title="GCC 常用参数">GCC 常用参数</span>
            <span class="post-date" title="2019-12-23 21:08:06">2019/12/23</span>
        </a>
        
        <a  class="Tools "
           href="/2019/12/25/Git-%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E8%AE%B0%E5%BD%95/"
           data-tag="Git"
           data-author="" >
            <span class="post-title" title="Git 常用命令记录">Git 常用命令记录</span>
            <span class="post-date" title="2019-12-25 22:33:06">2019/12/25</span>
        </a>
        
        <a  class="嵌入式 "
           href="/2019/12/21/IIC%E6%80%BB%E7%BA%BF/"
           data-tag="嵌入式,IIC"
           data-author="" >
            <span class="post-title" title="IIC总线">IIC总线</span>
            <span class="post-date" title="2019-12-21 23:05:18">2019/12/21</span>
        </a>
        
        <a  class="Linux "
           href="/2019/12/25/Linux-MTD-Subsystem/"
           data-tag="Linux,MTD Subsystem"
           data-author="" >
            <span class="post-title" title="Linux-MTD-Subsystem">Linux-MTD-Subsystem</span>
            <span class="post-date" title="2019-12-25 18:08:18">2019/12/25</span>
        </a>
        
        <a  class="Tools "
           href="/2020/01/13/ubuntu%E4%B8%8A%E6%90%AD%E5%BB%BAdokuwiki/"
           data-tag="dokuwiki,ubuntu"
           data-author="" >
            <span class="post-title" title="ubuntu上搭建dokuwiki">ubuntu上搭建dokuwiki</span>
            <span class="post-date" title="2020-01-13 20:00:38">2020/01/13</span>
        </a>
        
        <a  class="Hexo "
           href="/2019/12/18/hello-world/"
           data-tag="Hexo"
           data-author="" >
            <span class="post-title" title="Hello World">Hello World</span>
            <span class="post-date" title="2019-12-18 19:43:05">2019/12/18</span>
        </a>
        
        <a  class="Tools "
           href="/2020/01/12/%E4%B8%8A%E5%8F%A4%E7%A5%9E%E5%99%A8-VIM/"
           data-tag="VIM"
           data-author="" >
            <span class="post-title" title="上古神器 VIM">上古神器 VIM</span>
            <span class="post-date" title="2020-01-12 10:24:00">2020/01/12</span>
        </a>
        
        <a  class="Hexo "
           href="/2019/12/18/%E5%9F%BA%E4%BA%8E-Hexo-Github-%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84%E5%8D%9A%E5%AE%A2/"
           data-tag="Hexo"
           data-author="" >
            <span class="post-title" title="基于 Hexo &amp; Github 搭建自己的博客">基于 Hexo &amp; Github 搭建自己的博客</span>
            <span class="post-date" title="2019-12-18 19:43:06">2019/12/18</span>
        </a>
        
    </nav>
</div>
    </div>
    <div class="hide-list">
        <div class="semicircle">
            <div class="brackets first"><</div>
            <div class="brackets">&gt;</div>
        </div>
    </div>
</aside>
<div class="post">
    <div class="pjax">
        <article id="post-ubuntu上搭建dokuwiki" class="article article-type-post" itemscope itemprop="blogPost">
    
        <h1 class="article-title">ubuntu上搭建dokuwiki</h1>
    
    <div class="article-meta">
        
        
        
        <span class="book">
            
                <a  data-rel="Tools">Tools</a>
            
        </span>
        
        
        <span class="tag">
            
            <a class="color4">dokuwiki</a>
            
            <a class="color2">ubuntu</a>
            
        </span>
        
    </div>
    <div class="article-meta">
        
        创建时间:<time class="date" title='更新时间: 2020-04-25 22:35:37'>2020-01-13 20:00</time>
        
    </div>
    <div class="article-meta">
        
        <span>字数:568</span>
        
        
        <span id="busuanzi_container_page_pv">
            阅读:<span id="busuanzi_value_page_pv">
                <span class="count-comment">
                    <span class="spinner">
                      <div class="cube1"></div>
                      <div class="cube2"></div>
                    </span>
                </span>
            </span>
        </span>
        
        
    </div>
    
    <div class="toc-ref">
    
        <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#安装web服务器和PHP"><span class="toc-text">安装web服务器和PHP</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#下载dokuwiki"><span class="toc-text">下载dokuwiki</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#安装"><span class="toc-text">安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#设置权限"><span class="toc-text">设置权限</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#将目录移出根文档"><span class="toc-text">将目录移出根文档</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#data-目录"><span class="toc-text">data 目录</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#conf-目录"><span class="toc-text">conf 目录</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#bin-目录"><span class="toc-text">bin 目录</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#inc-目录"><span class="toc-text">inc 目录</span></a></li></ol></li></ol></li></ol>
    
<style>
    .left-col .switch-btn,
    .left-col .switch-area {
        display: none;
    }
    .toc-level-3 i,
    .toc-level-3 ol {
        display: none !important;
    }
</style>
</div>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><a href="https://www.dokuwiki.org/manual" target="_blank" rel="noopener">dokuwiki 官方使用手册</a></p>
<blockquote>
<p>搭建环境：</p>
<p>ubuntu（16.04）</p>
</blockquote>
<h3 id="安装web服务器和PHP"><a href="#安装web服务器和PHP" class="headerlink" title="安装web服务器和PHP"></a>安装web服务器和PHP</h3><pre><code class="bash">sudo apt-get install apache2 php7.0 php7.0-fpm php7.0-cli php-apcu php7.0-gd php7.0-xml php7.0-curl php7.0-json php7.0-mcrypt php7.0-cgi libapache2-mod-php7.0 php-patchwork-utf8</code></pre>
<h3 id="下载dokuwiki"><a href="#下载dokuwiki" class="headerlink" title="下载dokuwiki"></a>下载dokuwiki</h3><p><a href="https://www.dokuwiki.org/dokuwiki" target="_blank" rel="noopener">下载链接</a></p>
<p>解压得到的文件夹 dokuwiki 放到 /var/www/html/ 下，如：</p>
<pre><code class="bash">zyao@ubuntu:~$ ls /var/www/html/
dokuwiki  index.html
zyao@ubuntu:~$ ls /var/www/html/dokuwiki/
bin  conf  COPYING  data  doku.php  feed.php  inc  index.php  lib  README  vendor  VERSION
zyao@ubuntu:~$</code></pre>
<p>更改文件夹权限，如：</p>
<pre><code class="bash">cd /var/www/html/dokuwiki
sudo chown -R www-data:www-data data conf</code></pre>
<h3 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h3><p>浏览器输入网址：<code>http://你的服务器IP/dokuwiki/install.php</code></p>
<h3 id="设置权限"><a href="#设置权限" class="headerlink" title="设置权限"></a>设置权限</h3><pre><code class="bash"># 1、
sudo mv data /home/zyao/.dokuwiki/ -f
# 2、追加一行内容：$conf[&#39;savedir&#39;] = &#39;/home/yourname/data/&#39;; 到conf/local.php
# 3、
mv conf /home/zyao/.dokuwiki/ -f
cd inc/
vi preload.php
mv bin /home/zyao/.dokuwiki/ -f</code></pre>
<h4 id="将目录移出根文档"><a href="#将目录移出根文档" class="headerlink" title="将目录移出根文档"></a>将目录移出根文档</h4><p>为了避免任何对上述目录的访问，最安全的方法就是把它们从 Web 服务所谓的“根文档”中移出来。</p>
<h5 id="data-目录"><a href="#data-目录" class="headerlink" title="data 目录"></a>data 目录</h5><ul>
<li>从根文档中移出 “data” 目录（和它所有的内容）</li>
<li>编辑 [[config:savedir]] 设置，使它指向 “data” 目录的新位置。</li>
</ul>
<p>例如，如果把 “data” 目录移动到 “/home/yourname/data”，添加以下这一行到 “conf/local.php”:</p>
<pre><code class="bash">  $conf[&#39;savedir&#39;] = &#39;/home/yourname/data/&#39;;</code></pre>
<h5 id="conf-目录"><a href="#conf-目录" class="headerlink" title="conf 目录"></a>conf 目录</h5><ul>
<li>从根文档中移出 “conf” 目录（和它所有的内容）</li>
<li>在 “inc” 目录内创建一个名为 preload.php 的文件,设置 “DOKU_CONF” 定义并使它指向 “conf” 目录的新地址。</li>
</ul>
<p>例如，如果把 “conf” 目录移动到 “/home/yourname/conf”,创建以下的 “inc/preload.php”文件：</p>
<p>&lt;code php inc/preload.php&gt;</p>
<pre><code class="php">&lt;?php

define(&#39;DOKU_CONF&#39;,&#39;/home/yourname/conf/&#39;);
&lt;/code&gt;</code></pre>
<h5 id="bin-目录"><a href="#bin-目录" class="headerlink" title="bin 目录"></a>bin 目录</h5><p>bin 目录包含了命令行工具。如果你没有 shell 可以访问你的服务器，你可以简单的删除该目录和它的内容。否则只要把它移出文档根即可。不需要更多的配置工作。</p>
<h5 id="inc-目录"><a href="#inc-目录" class="headerlink" title="inc 目录"></a>inc 目录</h5><p>从文档根中移出该目录，直到目前还没有简单的方法。但是因为它不包含任何的敏感数据，所以不值得努力尝试移出它了。</p>
<p><a href="https://www.dokuwiki.org/start?id=zh:security" target="_blank" rel="noopener">参考这里</a></p>
<p>参考博客：</p>
<p><a href="https://blog.csdn.net/wszll_Alex/article/details/80250249" target="_blank" rel="noopener">参考一</a>、<a href="https://linux.cn/article-8178-1.html" target="_blank" rel="noopener">参考二</a>、<a href="https://my.oschina.net/xiangxw/blog/36233" target="_blank" rel="noopener">参考三</a>、<a href="https://blog.csdn.net/boyStray/article/details/77113945" target="_blank" rel="noopener">dokuwiki升级</a></p>
<p><strong>效果展示：</strong><br><img src="https://gitee.com/zhangyaaoo/blogpics/raw/master/misc/2019-10-15_152955-dokuwiki-mainpage.png" alt=""></p>

      
       <hr><span style="font-style: italic;color: gray;"> 转载请注明来源，欢迎对文章中的内容批评指正. 可以邮件至 zh.yao@foxmail.com </span>
    </div>
</article>



<div class="article_copyright">
    <p><span class="copy-title">文章标题:</span>ubuntu上搭建dokuwiki</p>
    <p><span class="copy-title">文章字数:</span><span class="post-count">568</span></p>
    <p><span class="copy-title">本文作者:</span><a  title="ZY">ZY</a></p>
    <p><span class="copy-title">发布时间:</span>2020-01-13, 20:00:38</p>
    <p><span class="copy-title">最后更新:</span>2020-04-25, 22:35:37</p>
    <span class="copy-title">原始链接:</span><a class="post-url" href="/2020/01/13/ubuntu%E4%B8%8A%E6%90%AD%E5%BB%BAdokuwiki/" title="ubuntu上搭建dokuwiki">http://yoursite.com/2020/01/13/ubuntu%E4%B8%8A%E6%90%AD%E5%BB%BAdokuwiki/</a>
    <p>
        <span class="copy-title">版权声明:</span><i class="fa fa-creative-commons"></i> <a rel="license noopener" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" title="CC BY-NC-SA 4.0 International" target = "_blank">"署名-非商用-相同方式共享 4.0"</a> 转载请保留原文链接及作者。
    </p>
</div>





    




    </div>
    <div class="copyright">
        <p class="footer-entry">©2016-2020 ZY</p>
<p class="footer-entry">Built with <a href="https://hexo.io/" target="_blank">Hexo</a> and <a href="https://github.com/yelog/hexo-theme-3-hexo" target="_blank">3-hexo</a> theme</p>

    </div>
    <div class="full-toc">
        <button class="full"><span class="min "></span></button>
<button class="post-toc-menu"><span class="post-toc-menu-icons"></span></button>
<div class="post-toc"><span class="post-toc-title">目录</span>
    <div class="post-toc-content">

    </div>
</div>
<a class="" id="rocket" ></a>

    </div>
</div>
<div class="acParent"></div>

</body>
<script src="/js/jquery.pjax.js?v=1.0.1" ></script>

<script src="/js/script.js?v=1.0.1" ></script>
<script>
    var img_resize = 'default';
    /*作者、标签的自动补全*/
    $(function () {
        $('.search').AutoComplete({
            'data': ['#GCC','#Git','#嵌入式','#IIC','#Linux','#MTD Subsystem','#dokuwiki','#ubuntu','#Hexo','#VIM',],
            'itemHeight': 20,
            'width': 418
        }).AutoComplete('show');
    })
    function initArticle() {
        /*渲染对应的表格样式*/
        

        /*渲染打赏样式*/
        

        /*高亮代码块行号*/
        
        $('pre code').each(function(){
            var lines = $(this).text().trim().split('\n').length, widther='';
            if (lines>99) {
                widther = 'widther'
            }
            var $numbering = $('<ul/>').addClass('pre-numbering ' + widther).attr("unselectable","on");
            $(this).addClass('has-numbering ' + widther)
                    .parent()
                    .append($numbering);
            for(var i=1;i<=lines;i++){
                $numbering.append($('<li/>').text(i));
            }
        });
        

        /*访问数量*/
        
        $.getScript("//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js");
        

        /*代码高亮，行号对齐*/
        $('.pre-numbering').css('line-height',$('.has-numbering').css('line-height'));

        
        
    }

    /*打赏页面隐藏与展示*/
    

</script>

<!--加入行号的高亮代码块样式-->

<style>
    pre{
        position: relative;
        margin-bottom: 24px;
        border-radius: 10px;
        border: 1px solid #e2dede;
        background: #FFF;
        overflow: hidden;
    }
    code.has-numbering{
        margin-left: 30px;
    }
    code.has-numbering.widther{
        margin-left: 35px;
    }
    .pre-numbering{
        margin: 0px;
        position: absolute;
        top: 0;
        left: 0;
        width: 20px;
        padding: 0.5em 3px 0.7em 5px;
        border-right: 1px solid #C3CCD0;
        text-align: right;
        color: #AAA;
        background-color: ;
    }
    .pre-numbering.widther {
        width: 35px;
    }
</style>

<!--自定义样式设置-->
<style>
    
    
    .nav {
        width: 542px;
    }
    .nav.fullscreen {
        margin-left: -542px;
    }
    .nav-left {
        width: 120px;
    }
    
    
    @media screen and (max-width: 1468px) {
        .nav {
            width: 492px;
        }
        .nav.fullscreen {
            margin-left: -492px;
        }
        .nav-left {
            width: 100px;
        }
    }
    
    
    @media screen and (max-width: 1024px) {
        .nav {
            width: 492px;
            margin-left: -492px
        }
        .nav.fullscreen {
            margin-left: 0;
        }
        .nav .hide-list.fullscreen {
            left: 492px
        }
    }
    
    @media screen and (max-width: 426px) {
        .nav {
            width: 100%;
        }
        .nav-left {
            width: 100%;
        }
    }
    
    
    .nav-right .title-list nav a .post-title, .nav-right .title-list #local-search-result a .post-title {
        color: #383636;
    }
    
    
    .nav-right .title-list nav a .post-date, .nav-right .title-list #local-search-result a .post-date {
        color: #5e5e5f;
    }
    
    
    .nav-right nav a.hover, #local-search-result a.hover{
        background-color: #e2e0e0;
    }
    
    

    /*列表样式*/
    

    /* 背景图样式 */
    
    


    /*引用块样式*/
    

    /*文章列表背景图*/
    
    .nav-right:before {
        content: ' ';
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        opacity: 0.3;
        background: url("https://i.loli.net/2019/07/22/5d3521411f3f169375.png");
        background-repeat: no-repeat;
        background-position: 50% 0;
        -ms-background-size: cover;
        -o-background-size: cover;
        -moz-background-size: cover;
        -webkit-background-size: cover;
        background-size: cover;
    }
    

    
    .post .pjax article :not(pre) > code {
        color: #24292e;
        font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;
        background-color: rgba(27,31,35,.05);
        border-radius: 3px;
        font-size: 85%;
        margin: 0;
        padding: .2em .4em;
    }
    
</style>







</html>
